package com.cjkj.purchase.service.impl;

import java.util.List;
import com.cjkj.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.cjkj.purchase.mapper.PurchaseOutboundRecordMapper;
import com.cjkj.purchase.domain.PurchaseOutboundRecord;
import com.cjkj.purchase.service.IPurchaseOutboundRecordService;

/**
 * 采购材料出库记录Service业务层处理
 * 
 * @author cjkj
 * @date 2025-02-20
 */
@Service
public class PurchaseOutboundRecordServiceImpl implements IPurchaseOutboundRecordService 
{
    @Resource
    private PurchaseOutboundRecordMapper purchaseOutboundRecordMapper;

    /**
     * 查询采购材料出库记录
     * 
     * @param recordId 采购材料出库记录主键
     * @return 采购材料出库记录
     */
    @Override
    public PurchaseOutboundRecord selectPurchaseOutboundRecordByRecordId(Long recordId)
    {
        return purchaseOutboundRecordMapper.selectPurchaseOutboundRecordByRecordId(recordId);
    }

    /**
     * 查询采购材料出库记录列表
     * 
     * @param purchaseOutboundRecord 采购材料出库记录
     * @return 采购材料出库记录
     */
    @Override
    public List<PurchaseOutboundRecord> selectPurchaseOutboundRecordList(PurchaseOutboundRecord purchaseOutboundRecord)
    {
        return purchaseOutboundRecordMapper.selectPurchaseOutboundRecordList(purchaseOutboundRecord);
    }

    /**
     * 新增采购材料出库记录
     * 
     * @param purchaseOutboundRecord 采购材料出库记录
     * @return 结果
     */
    @Override
    public int insertPurchaseOutboundRecord(PurchaseOutboundRecord purchaseOutboundRecord)
    {
        purchaseOutboundRecord.setCreateTime(DateUtils.getNowDate());
        return purchaseOutboundRecordMapper.insertPurchaseOutboundRecord(purchaseOutboundRecord);
    }

    /**
     * 修改采购材料出库记录
     * 
     * @param purchaseOutboundRecord 采购材料出库记录
     * @return 结果
     */
    @Override
    public int updatePurchaseOutboundRecord(PurchaseOutboundRecord purchaseOutboundRecord)
    {
        purchaseOutboundRecord.setUpdateTime(DateUtils.getNowDate());
        return purchaseOutboundRecordMapper.updatePurchaseOutboundRecord(purchaseOutboundRecord);
    }

    /**
     * 批量删除采购材料出库记录
     * 
     * @param recordIds 需要删除的采购材料出库记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseOutboundRecordByRecordIds(Long[] recordIds)
    {
        return purchaseOutboundRecordMapper.deletePurchaseOutboundRecordByRecordIds(recordIds);
    }

    /**
     * 删除采购材料出库记录信息
     * 
     * @param recordId 采购材料出库记录主键
     * @return 结果
     */
    @Override
    public int deletePurchaseOutboundRecordByRecordId(Long recordId)
    {
        return purchaseOutboundRecordMapper.deletePurchaseOutboundRecordByRecordId(recordId);
    }
}
